package proxypattern;

public class ProxyImage implements Image {
    private String fileName;

    private RealImage realImage;

    public ProxyImage(final String name) {
        this.fileName = name;
    }

    @Override
    public void display() {
        if (null == realImage) {
            realImage = new RealImage(fileName);
        }
        realImage.display();
    }

}
